/*
day392 
2020.9.23 
*/ 
#include<iostream>
#include<unordered_map>
#include<vector>
using namespace std;


class Solution {
public:
    bool hasGroupsSizeX(vector<int>& deck) {
		unordered_map<int,int> m;
		for(int i=0;i<deck.size();++i)
		{
			m[deck[i]]++;
		}
		
		int tem=m.begin()->second;
		for(auto &i : m)
		{
			tem=gcd(tem,i.second);
		}
		
		return tem>=2;
    }
    
    int gcd(int x,int y)
    {
    	if(x<y)
    	{
    		int tem=x;
    		x=y;
    		y=tem;
		}
		
//		x>y
		if(y==0)
		{
			return x;
		}
		
		return gcd(x%y,y);
	}
};

int main()
{
	return 0;
}
